<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserAddressTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up() {
        Schema::create('user_address', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('收货人姓名');
            $table->string('telphone')->comment('收货人手机号码');
            $table->string('area')->comment('所在地区');
            $table->string('detail_address')->comment('详细地址');
            $table->tinyInteger('is_default')->default(0)->comment('是否是默认地址 0:否 1:是');
            $table->integer('user_id')->comment('所属用户id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down() {
        Schema::dropIfExists('user_address');
    }

}
